<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title site-title">
			<legend><a name="fixbar" style="font-size: 16px; color: #ce2424;">权限设置</a></legend>
		</fieldset>
		<form class="layui-form" action="save" id="myForm" method="post" lay-filter="stuform">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">名称</label>
    		<div class="layui-input-block">
      			<input type="text" name="name" value="${param.name}"  autocomplete="off" placeholder="请输入名称" class="layui-input">
    		</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">代码</label>
    		<div class="layui-input-block">
      			<input type="text" name="code" value="${param.code}"  autocomplete="off" placeholder="请输入代码" class="layui-input">
    		</div>
				</div>
				<div class="layui-inline">
					<button type="button" class="layui-btn layui-btn-danger" onclick="search()" >查询</button>
					<button type="button" class="layui-btn layui-btn-danger" onclick="empty()" >清空</button>
				</div>
			</div>
		</form>


<table id="permission_table"></table>
<script type="text/html" id="toolbarDemo">
	<div class="layui-btn-container">
		<button class="layui-btn layui-btn-sm" lay-event="add_panel">新增</button>
  	</div>
</script>

	<script type="text/javascript">
		var option={
			elem:'#permission_table',
			title:'学生列表',
			path:'permission',
			addurl:'edit',
			where:{name:'${param.name}',code:'${param.code}'},
			//winWidth: '800px',
			toolbar:'#toolbarDemo',
			cols : [ 
				[ {
					field : 'name',
					title : '名称'
				}, {
					field : 'code',
					title : '代码'
				},
				{fixed: 'right', title:'操作', toolbar: '#barDemo2', width:200}
				] 
			]
		}
		var currRow="${param.currRow==null?'null':param.currRow}";
		var limit=${param.limit==null?'null':param.limit};
		var page=${param.page==null?'null':param.page};
		var classTable=new LayUiTable(option,currRow,limit,page);
		classTable.init();
		
		function search(){
			classTable.search();
		}
		
		function empty(){
			classTable.empty();
		}
	</script>
</body>
</html>